﻿@model Domain.Entities.User

@{
    ViewBag.Title = "Редактирование пользователя";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

<h2>Редактирование пользователя</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Пользователь</legend>

        @Html.HiddenFor(model => model.Id)

        <table class="table_none">
            <tr>
                <td class="editor-label">@Html.LabelFor(model => model.Login)</td>
                <td class="editor-field">@Html.EditorFor(model => model.Login)
                     @Html.ValidationMessageFor(model => model.Login)</td>
            </tr>
            <tr>
                <td class="editor-label">Пароль</td>
                <td class="editor-field">@Html.EditorFor(model => model.Password)
            @Html.ValidationMessageFor(model => model.Password)</td>
            </tr>
            <tr>
                <td class="editor-label">@Html.LabelFor(model => model.Email)</td>
                <td class="editor-field">@Html.EditorFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)</td>
            </tr>
            <tr>
                <td class="editor-label">Имя</td>
                <td class="editor-field">@Html.EditorFor(model => model.FirstName)
            @Html.ValidationMessageFor(model => model.FirstName)</td>
            </tr>
            <tr>
                <td class="editor-label">Фамилия</td>
                <td class="editor-field">@Html.EditorFor(model => model.LastName)
            @Html.ValidationMessageFor(model => model.LastName)</td>
            </tr>
            <tr>
                <td class="editor-label">Отчество</td>
                <td class="editor-field">@Html.EditorFor(model => model.MiddleName)
            @Html.ValidationMessageFor(model => model.MiddleName)</td>
            </tr>
            <tr>
                <td class="editor-label">Роль</td>
                <td class="editor-field">@Html.DropDownList("RoleId")
            @Html.ValidationMessageFor(model => model.RoleId)</td>
            </tr>
            <tr>
                <td class="editor-label">Адрес</td>
                <td class="editor-field">@Html.EditorFor(model => model.Address)
            @Html.ValidationMessageFor(model => model.Address)</td>
            </tr>
            <tr>
                <td class="editor-label">Город</td>
                <td class="editor-field">@Html.EditorFor(model => model.City)
            @Html.ValidationMessageFor(model => model.City)</td>
            </tr>
            <tr>
                <td class="editor-label">Штат</td>
                <td class="editor-field">@Html.EditorFor(model => model.State)
            @Html.ValidationMessageFor(model => model.State)</td>
            </tr>
            <tr>
                <td class="editor-label">Почтовый индекс</td>
                <td class="editor-field">@Html.EditorFor(model => model.PostalCode)
            @Html.ValidationMessageFor(model => model.PostalCode)</td>
            </tr>
            <tr>
                <td class="editor-label">Телефон</td>
                <td class="editor-field">@Html.EditorFor(model => model.Phone)
            @Html.ValidationMessageFor(model => model.Phone)</td>
            </tr>

        </table>

        <p>
            <input type="submit" value="Сохранить" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("К списку пользователей", "BrowseUsers")
</div>
